﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
using TestCommunityMvvmToolkit.Views;

namespace TestCommunityMvvmToolkit
{
    public partial class TopLevelViewModel : AliveViewModel
    {
        [ObservableProperty]
        private string? name;

        [ObservableProperty]
        private AnimalBase activeItem = new DogViewModel();

        [ICommand]
        private void ChangeAnimal()
        {
            ActiveItem = ActiveItem switch
            {
                DogViewModel => new CatViewModel(),
                _ => new DogViewModel()
            };
        }
    }
}